package gates;

/**
 * A representation of the S gate defined in <a href="http://arxiv.org/abs/quant-ph/0301079">Grover's Algorithm: Quantum Database Search</a>
 * Since this is just a phaseshift gate, wrap a phaseshift gate in a composite
 * @author Alex Bush
 *
 */
public class SEnclosing extends CompositeGate {
	
	/**
	 * Private constructor to construct a S gate.
	 * @param target Target qubit for register to act on
	 */
	protected SEnclosing(int target){
		super(createGate(target));
	}
	
	/**
	 * Private method to create the appropriate phaseshift gate. For S this is Pi/2
	 */
	private static Gate[] createGate(int target){
		Gate[] phase = {Factory.createPhaseShift(target, Math.PI/2.0)};
		return phase;
	}

}
